package com.cloudcentral.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 探测任务记录表
 * </p>
 *
 * @author Administrator
 * @since 2023-11-23
 */
@Data
@SuperBuilder
@JsonSerialize
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sys_detect")
@Schema(name = "Detect", description = "探测任务记录表")
public class Detect implements Serializable {

  @Schema(description = "ID")
  @TableId(type = IdType.AUTO)
  private Long id;

  @Schema(description = "禁用频率表ID")
  @TableField(keepGlobalFormat = true)
  private Long disabledFrequencyId;

  @Schema(description = "主站ID")
  @TableField(keepGlobalFormat = true)
  private Integer masterId;

  @Schema(description = "从站ID")
  @TableField(keepGlobalFormat = true)
  private Integer slaveId;

  @Schema(description = "监听站ID(逗号分隔)")
  @TableField(keepGlobalFormat = true)
  private String listenerIds;

  @Schema(description = "名称")
  @TableField(keepGlobalFormat = true)
  private String name;

  @Schema(description = "任务类型(continue,连续探测;selected,选频探测;)")
  @TableField(keepGlobalFormat = true)
  private String type;

  @Schema(description = "创建时间")
  @TableField(keepGlobalFormat = true, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date createTime;

  @Schema(description = "更新时间")
  @TableField(keepGlobalFormat = true, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date updateTime;
}
